<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var list = [1, 2, 1, 1, 3, 3, 4, 5, 6, 7]
        for (var i = list.length; i > 0; i--) {
            for (var j = i - 1; j >= 0; j--) {
                if (list[i] === list[j]) {
                    list.splice(j, 1)
                }
            }
        }
        // for (var j = 0; j < list.length; j++) {


        //     for (var i = j + 1; i < list.length; i++) {
        //         if (list[i] === list[j]) {
        //             list.splice(j, 1)
        //             i--
        //         }
        //     }
        // }
        console.log(list)
    </script>
</body>

</html>